package com.zmx.product.entity;

import com.zmx.common.common.entitys.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.Where;

/**
 * @author zhaomxr
 * null
 */
@Data
@Entity
@Table(name = "product_category")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper=true)
@Inheritance(strategy = InheritanceType.JOINED)
@Where(clause = "is_vaild = 1 and dr = 0")
public class ProductCategory extends BaseEntity {

	/**
	 * 分类名称
	 */
	@Column(name = "name")
	private String name;

	/**
	 * 父id
	 */
	@Column(name = "parent_id")
	private Long parentId;

	/**
	 * 级别
	 */
	@Column(name = "grade")
	private Integer grade;

	/**
	 * 是否末级分类
	 */
	@Column(name = "is_bottom")
	private Integer isBottom;

	/**
	 * 排名等级
	 */
	@Column(name = "ranking")
	private Integer ranking;

	/**
	 * 是否有效  0-无效，1-有效
	 */
	@Column(name = "is_vaild")
	private Integer isVaild;

	/**
	 * 备注
	 */
	@Column(name = "remark")
	private String remark;
}
